home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 54 / 054.d81 / star copier (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  9KB  |  272 lines

  1. 0 ifa=.thena=1:load"copier.o",8,1
  2. 4 goto100
  3. 10 sys sd,dn$,bf%,nf%,fi$(.),nb%(.),ft%(.),s%(.),tr%(.),se%(.),l$(.):return
  4. 28 :
  5. 30 poke214,4:print:printtab(11)"[154]"s$(cs)
  6. 32 print"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":poke1303,100:pokeco+1303,2
  7. 34 poke214,6:print:fora=1to14
  8. 36 print"                                        "
  9. 38 next
  10. 39 return
  11. 40 poke214,21:print
  12. 42 fora=1to2:print"                                       ":next
  13. 44 print"[145][145]";:return
  14. 50 b=.:fora=8to11:open15,a,15:close15
  15. 52 d(a-7)=.:ifst=.thend(a-7)=a:b=b+1
  16. 54 next:fora=1to4:ifd(a)<>.thensd%=d(a):a=4
  17. 56 next:ifb=1thentd%=sd%:return
  18. 58 fora=sd%-6to4:ifd(a)<>.thentd%=d(a):a=4
  19. 60 next:return
  20. 65 hi=int(a/256):lo=a-hi*256:return
  21. 70 open15,sd%,15,"i0":input#15,er,er$,tr,se:close15:ok=-1:ifer=.thenreturn
  22. 71 poke214,15:print:fora=1to3:print"                                      "
  23. 72 next:print"[145][145][145]          --- drive error ---"
  24. 73 a$="error:"+str$(er)+" "+er$:printtab((20-len(a$)/2)+1)a$
  25. 74 print"[154]       track:"tr;tab(23)"[154]sector:"se:ok=not(ok):return
  26. 75 gosub40:print"        [154]press space [154]to return to"
  27. 76 print"             the main menu":poke198,.
  28. 78 ifpeek(203)<>60then78
  29. 79 return
  30. 80 s$(1)="  view directory  "
  31. 81 s$(2)="    copy files    "
  32. 82 s$(3)="  scratch  files  "
  33. 83 s$(4)="   disk command   "
  34. 84 s$(5)="   quit program   "
  35. 89 :
  36. 90 m$(1)="1. view directory"
  37. 91 m$(2)="2. copy files    "
  38. 92 m$(3)="3. scratch files "
  39. 93 m$(4)="4. disk command  "
  40. 94 m$(5)="5. quit program  "
  41. 99 return
  42. 100 poke55,.:poke56,64:clr:poke650,128
  43. 120 poke53280,2:poke53281,.:co=54272
  44. 130 op=16384:ni=op+29:en=op+176
  45. 135 sl=16754:up=17633:dn=up+3
  46. 136 re=17903:wr=18269:sd=18420
  47. 140 dim fi$(144),nb$(144),ft%(144),s%(144),l$(144),nf%,ns%,tr%(144),se%(144)
  48. 145 dim sa(145)
  49. 146 cs=1:ns=5:dim m$(ns),s$(ns),d(4)
  50. 150 t$(.)="del":t$(5)=" deleted  "
  51. 151 t$(1)="seq":t$(6)="sequential"
  52. 152 t$(2)="prg":t$(7)=" program  "
  53. 153 t$(3)="usr":t$(8)="   user   "
  54. 154 t$(4)="rel":t$(9)=" relative "
  55. 159 sp$="                "
  56. 160 printchr$(142)"[147]              [158]star copier"
  57. 170 print"            by mike maynard"
  58. 180 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  59. 190 gosub80:gosub50
  60. 200 ifflthenpoke214,21:print:goto217
  61. 210 gosub34:print"               [154]main menu              "
  62. 211 print"[158][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":poke1303,100:pokeco+1303,7
  63. 212 fora=1tons+2
  64. 213 print"[150]                                        ";:next
  65. 214 print"[146][158][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke1623,99:poke1623+co,7
  66. 215 poke214,20:print
  67. 216 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke1903,99:poke1903+co,2
  68. 217 print"    [154]use the cursor keys [154]to move the"
  69. 218 print" reversed area. press return [154]to select.":ifflthen250
  70. 219 fora=217to242:pokea,peek(a)or128:next:poke214,7:print
  71. 220 fora=1tons
  72. 230 ifa=csthenprinttab(11)""m$(a):goto245
  73. 240 printtab(11)"[150]"m$(a)
  74. 245 next
  75. 250 poke214,15:print:print"                                      [145]"
  76. 255 print"        source device number:[153]"sd%:pokeop+3,sd%
  77. 256 print"                                      "
  78. 260 poke214,17:print:print"                                      [145]"
  79. 265 print"        target device number:[153]"td%
  80. 266 print"                                     ":ifflthen280
  81. 270 poke214,6+ls:print:printtab(11)"[150]"m$(ls)
  82. 275 poke214,6+cs:print:printtab(11)""m$(cs)
  83. 280 ls=cs:fl=.
  84. 290 a=peek(203):ifa<>13anda<>22anda<>1anda<>7anda<>2then290
  85. 295 ifa=1then on cs goto 1000,2000,3000,4000,5000
  86. 297 ifa=13ora=22then400
  87. 300 if(peek(653)and1)then360
  88. 310 ifa=7thencs=cs+1:ifcs>nsthencs=1
  89. 320 ifa=2thencs=cs-1:ifcs=.thencs=ns
  90. 350 goto270
  91. 360 ifa=7thencs=cs-1:ifcs=.thencs=ns
  92. 370 ifa=2thencs=cs+1:ifcs>nsthencs=1
  93. 380 goto270
  94. 400 ifa=13thensd%=sd%+1:ifsd%=12thensd%=8
  95. 410 ifa=22thentd%=td%+1:iftd%=12thentd%=8
  96. 415 ifd(sd%-7)=.ord(td%-7)=.then400
  97. 420 poke214,15:print:printtab(29)"[153]"sd%"[157] ":pokeop+3,sd%
  98. 430 poke214,17:print:printtab(29)"[153]"td%"[157] "
  99. 440 goto290
  100. 1000 gosub70:ifnot(ok)thenfl=1:goto1130
  101. 1002 poke1020,8:poke1021,1:poke1022,40:poke1023,14
  102. 1003 gosub30:gosub40:print"           [154]press:  p[154] to pause"
  103. 1004 print"                   a[154] to abort"
  104. 1010 poke214,6:print:sys(op)
  105. 1020 sys(ni),dn$,bf%:bf$=str$(bf%):bf$=right$("00"+right$(bf$,len(bf$)-1),3)
  106. 1030 id$=right$(dn$,2):dn$=left$(dn$,16):poke1020,9:poke1023,13
  107. 1035 poke214,4:print:print"[154]  disk name:"dn$tab(33)"[154]id:"id$"[153]":bu%=.:nf%=.
  108. 1040 print" [158]blks[221] [158]type [221]    [158]filename     [221][158]trk [221][158]sec":ln%=1:poke198,.
  109. 1050 sys(en),fi$,nb%,ft%
  110. 1052 s=.:ifft%<5thens=1
  111. 1054 ft%=ft%and127
  112. 1060 nb$="   "+str$(nb%):nb$=right$(nb$,3):ifft%<1then1084
  113. 1070 bu%=bu%+nb%:nf%=nf%+1:ln%=ln%+1:ifln%>14thenln%=14:sysup:print"[145][145]"
  114. 1075 tr$=right$(" "+str$(peek(re+3)),2):se$=right$(" "+str$(peek(re+4)),2)
  115. 1080 print" [153]"nb$" [221] ";:if(ft%and64)thenft%=ft%and63:print"[157][156]>";
  116. 1081 print" ";:if(s)thenprint"[157]*";
  117. 1082 print"[153]"t$(ft%and15)" [221][153]";:poke212,1:printleft$(fi$+sp$,16);
  118. 1083 poke212,.:print" [221][153] "tr$" [221][153] "se$
  119. 1084 geta$:ifa$<>"a"anda$<>"p"then1100
  120. 1085 ifa$="a"then1096
  121. 1086 cl=peek(214):gosub40:print"         [158]view directory paused"
  122. 1088 print"        [154]press space [154]to continue":poke198,.
  123. 1090 ifpeek(203)<>60then1090
  124. 1092 gosub40:print"           [154]press:  p[154] to pause"
  125. 1094 print"                   a[154] to abort[153]":poke214,cl-1:print:goto1100
  126. 1096 ifln%<13then1098
  127. 1097 forb=1to((ln%=13)*-1+(ln%=14)*-2):sysup:print"[145][145]":next
  128. 1098 print"         [150]view directory aborted!":ln%=ln%+2:ifln%>14thenln%=14
  129. 1099 close3:close15:bu$="???":ot$=bu$:nf$=bu$:goto1110
  130. 1100 ifpeek(2)=.then1050
  131. 1105 bu$=str$(bu%):bu$=right$("00"+right$(bu$,len(bu$)-1),3)
  132. 1106 ot$=str$(664-bf%-bu%):ot$=right$("00"+right$(ot$,len(ot$)-1),3)
  133. 1107 nf$=str$(nf%):nf$=right$("00"+right$(nf$,len(nf$)-1),3)
  134. 1110 ifln%<13then1120
  135. 1112 forb=1to((ln%=13)*-2+(ln%=14)*-3):sysup:print"[145][145]":next
  136. 1120 print" [158]blocks->[154]free:"bf$"  [154]used:"bu$"  [154]other:"ot$
  137. 1125 print"[154]       total number of files:"nf$
  138. 1130 poke1020,8:poke1023,14:gosub75:goto200
  139. 2000 gosub9000:ifnot(ok)then1130
  140. 2010 gosub6500
  141. 2020 gosub30:poke214,6:print
  142. 2030 fora=1to14:printtab(19)"[221]":next
  143. 2035 poke214,6:print:printtab(5)"[158]reading:"tab(26)"writing:":c1%=.:c2%=.
  144. 2040 cf%=1:f%=.:ln%=.:ap%=.:fu%=.
  145. 2050 bf%=1:sa(1)=24458:poke214,c1%+7:print                              
  146. 2060 poke1020,9:poke1021,1:poke1022,18:poke1023,13
  147. 2100 ifs%(cf%)=.then2160
  148. 2102 ifft%(cf%)>4then2110
  149. 2104 ifc1%>11thenforb=1to((c1%=12)*-1+(c1%=13)*-2):sysup:print"[145][145]":next
  150. 2106 c1%=c1%+1:s%(cf%)=.:a$=fi$(cf%):print
  151. 2107 print"[145]"tab(10-len(a$)/2)"[150]"a$:printtab(2)"can't copy splat"
  152. 2108 ns%=ns%-1:ifns%=.then2290
  153. 2109 goto2160
  154. 2110 c1%=c1%+1:if(c1%>13)and(fu%=.)thenc1%=13:sysup:print"[145][145]"
  155. 2113 if(fu%)thenprint"[145][145]"
  156. 2115 a$=fi$(cf%):printtab(10-len(a$)/2)""a$
  157. 2120 a=sa(bf%):gosub65:poke251,lo:poke252,hi
  158. 2125 if(fu%)thenfu%=.:tr%(cf%)=tk%:se%(cf%)=sc%
  159. 2130 sys(re),sd%,tr%(cf%),se%(cf%)
  160. 2135 print"[145]"tab(10-len(a$)/2)""a$
  161. 2140 if(peek(2)and3)then6000
  162. 2142 if(peek(2)and32)thenfu%=1:tk%=peek(re+3):sc%=peek(re+4):goto2150
  163. 2144 if(peek(2)and128)then6100
  164. 2150 bf%=bf%+1:sa(bf%)=peek(251)+peek(252)*256:if(fu%)then2170
  165. 2160 cf%=cf%+1:ifcf%<=nf%then2100
  166. 2170 ifsd%<>td%then2200
  167. 2180 gosu